package com.example.springsecurity.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springsecurity.entity.SystemUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 用户信息表(SystemUser)表数据库访问层
 *
 * @author aman
 * @since 2025-01-15 16:58:34
 */
@Mapper
public interface SystemUserMapper extends BaseMapper<SystemUser> {

    @Select("SELECT su.*  FROM system_user su where su.mobile = #{userPhone}")
    SystemUser selectUserInfoByUserPhone(String userPhone);

    @Update("update system_user set enable_captcha = #{enableCaptcha} where mobile = #{userPhone}")
    void updateUserInfoByUserName(String userPhone, int enableCaptcha);
}
